﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing;

namespace einuorg_console
{
    public class JohnTurner
    {
        public static void Initialize()
        {
            Terminal.WriteLineCenter("John Turner", "-");
            Terminal.Separator(Terminal.SeparatorState.SmallCenter, ConsoleColor.Red);
            Terminal.Tab(Terminal.TabState.Default);
            Terminal.WriteLine("Select application: ");
            Terminal.EmptyLine();
            Terminal.Brackets("1", Terminal.BracketState.Default);
            Terminal.WriteLine("Server");
            Terminal.Brackets("2", Terminal.BracketState.Default);
            Terminal.WriteLine("Client");
            Terminal.EmptyLine();
            Terminal.Write("Type in application number: ");

            string input = Console.ReadLine();
            switch (input)
            {
                case "1":
                    UDPserver.Initialize("192.168.1.255", 3468);
                    break;

                case "2":
                    UDPclient.Initialize(3468, false);
                    break;
            }
        }

        public static void Shell()
        {
            String command;
            Boolean quitNow = false;
            while (!quitNow)
            {
                Terminal.Write("JohnTurner@: ", ConsoleColor.Cyan);
                command = Console.ReadLine();
                switch (command)
                {
                    case "/help":
                        Terminal.Tab(Terminal.TabState.Info);
                        Terminal.WriteLine("This should be help.", ConsoleColor.White);
                        break;

                    case "/version":
                        Console.WriteLine("    This should be version.");
                        break;

                    case "/quit":
                        quitNow = true;
                        break;

                    case "/clear":
                        Terminal.Clear();
                        break;

                    case "/getinfo zlatko":
                        Terminal.Tab(Terminal.TabState.Error);
                        Terminal.WriteLine("ERROR: SYSTEM OVERLOADED");
                        break;

                    default:
                        Terminal.Tab(Terminal.TabState.Error);
                        Terminal.Write("Unknown Command ");
                        Terminal.WriteLine(command, ConsoleColor.DarkGreen);
                        break;
                }
            }
        }
        public static void GuessGame()
        {
            Random random = new Random();
            int numberToGuess = random.Next(100) + 1;
            int userGuess = 0;

            while (userGuess != numberToGuess)
            {
                Terminal.Tab(Terminal.TabState.Warning);
                Console.Write("Enter your guess: ");
                int.TryParse(Console.ReadLine(), out userGuess);

                if (userGuess > numberToGuess)
                {
                    Terminal.Tab(Terminal.TabState.Error);
                    Console.WriteLine("{0} is too high!", userGuess);
                }
                else if (userGuess < numberToGuess)
                {
                    Terminal.Tab(Terminal.TabState.Error);
                    Console.WriteLine("{0} is too low!", userGuess);
                }
                else
                {
                    Terminal.Tab(Terminal.TabState.Success);
                    Console.WriteLine("{0} is right! Congratulations.", userGuess);
                }
            }
            Console.ReadLine();
        }
        public static void SystemInfo()
        {
            Console.WriteLine("ActiveWindowTrackingDelay: {0}", System.Windows.Forms.SystemInformation.ActiveWindowTrackingDelay);
            Console.WriteLine("ArrangeDirection: {0}", System.Windows.Forms.SystemInformation.ArrangeDirection);
            Console.WriteLine("ArrangeStartingPosition: {0}", System.Windows.Forms.SystemInformation.ArrangeStartingPosition);
            Console.WriteLine("BootMode: {0}", System.Windows.Forms.SystemInformation.BootMode);
            Console.WriteLine("Border3DSize: {0}", System.Windows.Forms.SystemInformation.Border3DSize);
            Console.WriteLine("BorderMultiplierFactor: {0}", System.Windows.Forms.SystemInformation.BorderMultiplierFactor);
            Console.WriteLine("BorderSize: {0}", System.Windows.Forms.SystemInformation.BorderSize);
            Console.WriteLine("CaptionButtonSize: {0}", System.Windows.Forms.SystemInformation.CaptionButtonSize);
            Console.WriteLine("CaptionHeight: {0}", System.Windows.Forms.SystemInformation.CaptionHeight);
            Console.WriteLine("CaretBlinkTime: {0}", System.Windows.Forms.SystemInformation.CaretBlinkTime);
            Console.WriteLine("CaretWidth: {0}", System.Windows.Forms.SystemInformation.CaretWidth);
            Console.WriteLine("ComputerName: {0}", System.Windows.Forms.SystemInformation.ComputerName);
            Console.WriteLine("CursorSize: {0}", System.Windows.Forms.SystemInformation.CursorSize);
            Console.WriteLine("DbcsEnabled: {0}", System.Windows.Forms.SystemInformation.DbcsEnabled);
            Console.WriteLine("DebugOS: {0}", System.Windows.Forms.SystemInformation.DebugOS);
            Console.WriteLine("DoubleClickSize: {0}", System.Windows.Forms.SystemInformation.DoubleClickSize);
            Console.WriteLine("DoubleClickTime: {0}", System.Windows.Forms.SystemInformation.DoubleClickTime);
            Console.WriteLine("DragFullWindows: {0}", System.Windows.Forms.SystemInformation.DragFullWindows);
            Console.WriteLine("DragSize: {0}", System.Windows.Forms.SystemInformation.DragSize);
            Console.WriteLine("FixedFrameBorderSize: {0}", System.Windows.Forms.SystemInformation.FixedFrameBorderSize);
            Console.WriteLine("FontSmoothingContrast: {0}", System.Windows.Forms.SystemInformation.FontSmoothingContrast);
            Console.WriteLine("FontSmoothingType: {0}", System.Windows.Forms.SystemInformation.FontSmoothingType);
            Console.WriteLine("FrameBorderSize: {0}", System.Windows.Forms.SystemInformation.FrameBorderSize);
            Console.WriteLine("HighContrast: {0}", System.Windows.Forms.SystemInformation.HighContrast);
            Console.WriteLine("HorizontalFocusThickness: {0}", System.Windows.Forms.SystemInformation.HorizontalFocusThickness);
            Console.WriteLine("HorizontalResizeBorderThickness: {0}", System.Windows.Forms.SystemInformation.HorizontalResizeBorderThickness);
            Console.WriteLine("HorizontalScrollBarArrowWidth: {0}", System.Windows.Forms.SystemInformation.HorizontalScrollBarArrowWidth);
            Console.WriteLine("HorizontalScrollBarHeight: {0}", System.Windows.Forms.SystemInformation.HorizontalScrollBarHeight);
            Console.WriteLine("HorizontalScrollBarThumbWidth: {0}", System.Windows.Forms.SystemInformation.HorizontalScrollBarThumbWidth);
            Console.WriteLine("IconHorizontalSpacing: {0}", System.Windows.Forms.SystemInformation.IconHorizontalSpacing);
            Console.WriteLine("IconSize: {0}", System.Windows.Forms.SystemInformation.IconSize);
            Console.WriteLine("IconSpacingSize: {0}", System.Windows.Forms.SystemInformation.IconSpacingSize);
            Console.WriteLine("IconVerticalSpacing: {0}", System.Windows.Forms.SystemInformation.IconVerticalSpacing);
            Console.WriteLine("IsActiveWindowTrackingEnabled: {0}", System.Windows.Forms.SystemInformation.IsActiveWindowTrackingEnabled);
            Console.WriteLine("IsComboBoxAnimationEnabled: {0}", System.Windows.Forms.SystemInformation.IsComboBoxAnimationEnabled);
            Console.WriteLine("IsDropShadowEnabled: {0}", System.Windows.Forms.SystemInformation.IsDropShadowEnabled);
            Console.WriteLine("IsFlatMenuEnabled: {0}", System.Windows.Forms.SystemInformation.IsFlatMenuEnabled);
            Console.WriteLine("IsFontSmoothingEnabled: {0}", System.Windows.Forms.SystemInformation.IsFontSmoothingEnabled);
            Console.WriteLine("IsHotTrackingEnabled: {0}", System.Windows.Forms.SystemInformation.IsHotTrackingEnabled);
            Console.WriteLine("IsIconTitleWrappingEnabled: {0}", System.Windows.Forms.SystemInformation.IsIconTitleWrappingEnabled);
            Console.WriteLine("IsKeyboardPreferred: {0}", System.Windows.Forms.SystemInformation.IsKeyboardPreferred);
            Console.WriteLine("IsListBoxSmoothScrollingEnabled: {0}", System.Windows.Forms.SystemInformation.IsListBoxSmoothScrollingEnabled);
            Console.WriteLine("IsMenuAnimationEnabled: {0}", System.Windows.Forms.SystemInformation.IsMenuAnimationEnabled);
            Console.WriteLine("IsMenuFadeEnabled: {0}", System.Windows.Forms.SystemInformation.IsMenuFadeEnabled);
            Console.WriteLine("IsMinimizeRestoreAnimationEnabled: {0}", System.Windows.Forms.SystemInformation.IsMinimizeRestoreAnimationEnabled);
            Console.WriteLine("IsSelectionFadeEnabled: {0}", System.Windows.Forms.SystemInformation.IsSelectionFadeEnabled);
            Console.WriteLine("IsSnapToDefaultEnabled: {0}", System.Windows.Forms.SystemInformation.IsSnapToDefaultEnabled);
            Console.WriteLine("IsTitleBarGradientEnabled: {0}", System.Windows.Forms.SystemInformation.IsTitleBarGradientEnabled);
            Console.WriteLine("IsToolTipAnimationEnabled: {0}", System.Windows.Forms.SystemInformation.IsToolTipAnimationEnabled);
            Console.WriteLine("KanjiWindowHeight: {0}", System.Windows.Forms.SystemInformation.KanjiWindowHeight);
            Console.WriteLine("KeyboardDelay: {0}", System.Windows.Forms.SystemInformation.KeyboardDelay);
            Console.WriteLine("KeyboardSpeed: {0}", System.Windows.Forms.SystemInformation.KeyboardSpeed);
            Console.WriteLine("MaxWindowTrackSize: {0}", System.Windows.Forms.SystemInformation.MaxWindowTrackSize);
            Console.WriteLine("MenuAccessKeysUnderlined: {0}", System.Windows.Forms.SystemInformation.MenuAccessKeysUnderlined);
            Console.WriteLine("MenuBarButtonSize: {0}", System.Windows.Forms.SystemInformation.MenuBarButtonSize);
            Console.WriteLine("MenuButtonSize: {0}", System.Windows.Forms.SystemInformation.MenuButtonSize);
            Console.WriteLine("MenuFont: {0}", System.Windows.Forms.SystemInformation.MenuFont);
            Console.WriteLine("MenuHeight: {0}", System.Windows.Forms.SystemInformation.MenuHeight);
            Console.WriteLine("MenuCheckSize: {0}", System.Windows.Forms.SystemInformation.MenuCheckSize);
            Console.WriteLine("MenuShowDelay: {0}", System.Windows.Forms.SystemInformation.MenuShowDelay);
            Console.WriteLine("MidEastEnabled: {0}", System.Windows.Forms.SystemInformation.MidEastEnabled);
            Console.WriteLine("MinimizedWindowSize: {0}", System.Windows.Forms.SystemInformation.MinimizedWindowSize);
            Console.WriteLine("MinimizedWindowSpacingSize: {0}", System.Windows.Forms.SystemInformation.MinimizedWindowSpacingSize);
            Console.WriteLine("MinimumWindowSize: {0}", System.Windows.Forms.SystemInformation.MinimumWindowSize);
            Console.WriteLine("MinWindowTrackSize: {0}", System.Windows.Forms.SystemInformation.MinWindowTrackSize);
            Console.WriteLine("MonitorCount: {0}", System.Windows.Forms.SystemInformation.MonitorCount);
            Console.WriteLine("MonitorsSameDisplayFormat: {0}", System.Windows.Forms.SystemInformation.MonitorsSameDisplayFormat);
            Console.WriteLine("MouseButtons: {0}", System.Windows.Forms.SystemInformation.MouseButtons);
            Console.WriteLine("MouseButtonsSwapped: {0}", System.Windows.Forms.SystemInformation.MouseButtonsSwapped);
            Console.WriteLine("MouseHoverSize: {0}", System.Windows.Forms.SystemInformation.MouseHoverSize);
            Console.WriteLine("MouseHoverTime: {0}", System.Windows.Forms.SystemInformation.MouseHoverTime);
            Console.WriteLine("MouseSpeed: {0}", System.Windows.Forms.SystemInformation.MouseSpeed);
            Console.WriteLine("MouseWheelPresent: {0}", System.Windows.Forms.SystemInformation.MouseWheelPresent);
            Console.WriteLine("MouseWheelScrollDelta: {0}", System.Windows.Forms.SystemInformation.MouseWheelScrollDelta);
            Console.WriteLine("MouseWheelScrollLines: {0}", System.Windows.Forms.SystemInformation.MouseWheelScrollLines);
            Console.WriteLine("NativeMouseWheelSupport: {0}", System.Windows.Forms.SystemInformation.NativeMouseWheelSupport);
            Console.WriteLine("Network: {0}", System.Windows.Forms.SystemInformation.Network);
            Console.WriteLine("PenWindows: {0}", System.Windows.Forms.SystemInformation.PenWindows);
            Console.WriteLine("PopupMenuAlignment: {0}", System.Windows.Forms.SystemInformation.PopupMenuAlignment);
            Console.WriteLine("PowerStatus: {0}", System.Windows.Forms.SystemInformation.PowerStatus);
            Console.WriteLine("PrimaryMonitorMaximizedWindowSize: {0}", System.Windows.Forms.SystemInformation.PrimaryMonitorMaximizedWindowSize);
            Console.WriteLine("PrimaryMonitorSize: {0}", System.Windows.Forms.SystemInformation.PrimaryMonitorSize);
            Console.WriteLine("RightAlignedMenus: {0}", System.Windows.Forms.SystemInformation.RightAlignedMenus);
            Console.WriteLine("ScreenOrientation: {0}", System.Windows.Forms.SystemInformation.ScreenOrientation);
            Console.WriteLine("Secure: {0}", System.Windows.Forms.SystemInformation.Secure);
            Console.WriteLine("ShowSounds: {0}", System.Windows.Forms.SystemInformation.ShowSounds);
            Console.WriteLine("SizingBorderWidth: {0}", System.Windows.Forms.SystemInformation.SizingBorderWidth);
            Console.WriteLine("SmallCaptionButtonSize: {0}", System.Windows.Forms.SystemInformation.SmallCaptionButtonSize);
            Console.WriteLine("SmallIconSize: {0}", System.Windows.Forms.SystemInformation.SmallIconSize);
            Console.WriteLine("TerminalServerSession: {0}", System.Windows.Forms.SystemInformation.TerminalServerSession);
            Console.WriteLine("ToolWindowCaptionButtonSize: {0}", System.Windows.Forms.SystemInformation.ToolWindowCaptionButtonSize);
            Console.WriteLine("ToolWindowCaptionHeight: {0}", System.Windows.Forms.SystemInformation.ToolWindowCaptionHeight);
            Console.WriteLine("UIEffectsEnabled: {0}", System.Windows.Forms.SystemInformation.UIEffectsEnabled);
            Console.WriteLine("UserDomainName: {0}", System.Windows.Forms.SystemInformation.UserDomainName);
            Console.WriteLine("UserInteractive: {0}", System.Windows.Forms.SystemInformation.UserInteractive);
            Console.WriteLine("UserName: {0}", System.Windows.Forms.SystemInformation.UserName);
            Console.WriteLine("VerticalFocusThickness: {0}", System.Windows.Forms.SystemInformation.VerticalFocusThickness);
            Console.WriteLine("VerticalResizeBorderThickness: {0}", System.Windows.Forms.SystemInformation.VerticalResizeBorderThickness);
            Console.WriteLine("VerticalScrollBarArrowHeight: {0}", System.Windows.Forms.SystemInformation.VerticalScrollBarArrowHeight);
            Console.WriteLine("VerticalScrollBarThumbHeight: {0}", System.Windows.Forms.SystemInformation.VerticalScrollBarThumbHeight);
            Console.WriteLine("VerticalScrollBarWidth: {0}", System.Windows.Forms.SystemInformation.VerticalScrollBarWidth);
            Console.WriteLine("VirtualScreen: {0}", System.Windows.Forms.SystemInformation.VirtualScreen);
            Console.WriteLine("WorkingArea: {0}", System.Windows.Forms.SystemInformation.WorkingArea);
        }
    }
}
